import request from '@apis/request';

// 根据user_id查询user_roles
const getRolesByUserId = (id) => { return request({ url: `user_roles/${id}`, method: 'get' })  }

// 给user_id添加role_id权限
const addRoleToUser = (user_id, role_id) => { return request({ url: `user_roles/${user_id}/${role_id}`, method: 'put' }) }

// 删除user_id的role_id权限
const removeRoleFromUser = (user_id, role_id) => { return request({ url: `user_roles/${user_id}/${role_id}`, method: 'delete' }) }

export default {
  getRolesByUserId,
  addRoleToUser,
  removeRoleFromUser
}